<?php require admin_tpl('header')?>

<style>
	.panel {float:left; width:48%;margin-right:10px;}
	.panel li {line-height:180%;}
	.panel li span {color:#555;}
</style>

<div class="main">
	<h3 style="padding:5px; font-size:16px; ">
	<script type="text/javascript">say_hello();</script>
	<?php echo $_USER['name']?>，你的身份是：
	<?php switch ($_USER['group']) {
		case 'admin' : echo '管理员'; break;
		case 'author' : echo '作者'; break;
		case 'user' : echo '会员'; break;
		default :  echo '非法用户'; break;
	}?>
	</h3>

	<div class="panel">
		<div class="title">官方动态 (当前版本：<?php echo 'JBlog v'.$stat['version'].' ('.$stat['release'].')'?>)</div>
		<div class="body">加载中...</div>
	</div>

	<div class="panel">
		<div class="title">系统更新</div>
		<div class="body" id="jblog_update_list">暂无可用更新...</div>
	</div>

	<div class="panel">
		<div class="title">统计信息</div>
		<div class="body">
			<ul>
				<li>文章统计：<span><?php echo $arccount?></span></li>
				<li>评论统计：<span><?php echo $cmtcount?></span></li>
				<li>附件大小：<span><?php echo $stat['attach_size']?></span></li>
				<li>数据库大小：<span><?php echo $stat['db_size']?></span></li>
			</ul>
		</div>
	</div>

	<div class="panel">
		<div class="title">系统信息</div>
		<div class="body">
			<ul>
				<li>服务器解析引擎：<span><?php echo $stat['server']?></span></li>
				<li>MySQL版本：<span><?php echo $stat['mysql']?></span></li>
				<li>文件上传：<span><?php echo $file_upload?></span></li>
				<li>全局变量 register_globals：<span><?php echo $register_globals?></span></li>
				<li>图形处理 GD Library：<span><?php echo $gd_version?></span></li>
			</ul>
		</div>
	</div>

	<div class="panel">
		<div class="title">系统信息</div>
		<div class="body">
			<ul>
				<li>服务器解析引擎：<span><?php echo $stat['server']?></span></li>
				<li>MySQL版本：<span><?php echo $stat['mysql']?></span></li>
				<li>文件上传：<span><?php echo $file_upload?></span></li>
				<li>全局变量 register_globals：<span><?php echo $register_globals?></span></li>
				<li>图形处理 GD Library：<span><?php echo $gd_version?></span></li>
				<li><a href="?mod=main&ac=phpinfo">更多信息&raquo;</a></li>
			</ul>
		</div>
	</div>
	<div class="panel">
		<div class="title">开发团队</div>
		<div class="body">
			<ul>
				<li>程序开发：<a href="http://www.lisijie.org" target="_blank">李思杰</a></li>
				<li>美工制作：<a href="http://www.lisijie.org" target="_blank">李思杰</a></li>
				<li>官方网站：<a href="http://www.lisijie.org" target="_blank">http://www.lisijie.org</a></li>
				<li>官方论坛：<a href="http://www.lisijie.org/bbs" target="_blank">http://www.lisijie.org/bbs</a></li>
			</ul>
		</div>
	</div>
</div>
<script src="http://www.lisijie.org/user/update.php?get=<?php echo $stat['update']?>"></script>
<script type="text/javascript">
$(function() { 
	$.getJSON('admin.php', 'mod=update&ac=check', function(data) {
		if ( data.upitems == null ) {
			return ;
		}
		var message = '<form method="post" action="?mod=update&ac=getlist"><input type="hidden" name="upitems" value="'+data.upitems+'" /><ul>';
		for (var i=0; i<data.upvers.length; i++ ) {
			message += '<li '+(data.upvers[i].issafe?'style="color:red"':'')+'>['+data.upvers[i].date+'] '+data.upvers[i].msg+'</li>';
		}
		message += '</ul><p><input type="submit" class="button" value="应用更新" /> <input type="button" onclick="skip_update('+data.lasttime+')" class="button" value="忽略更新" /></p></form>';
		$('#jblog_update_list').html(message);
	});
});
function skip_update(lasttime) {
	$.get('admin.php', 'mod=update&ac=skip&lasttime='+lasttime, function(msg) {
		if ( msg == 'success' ) {
			$('#jblog_update_list').html('暂无可用更新...');
		}
	});
}
</script>
<?php require admin_tpl('footer')?>